<template>
  <div class="particular-fotre">
    <h3>{{parenst.title}}</h3>
    <p class="strate">
      <span>{{parenst.add_time|dateFormat}}</span>
      <span>{{parenst.click}}</span>
    </p>
    <div class="photosBox">
      <vue-preview :slides="slide1"></vue-preview>
    </div>

    <!-- <img class="preview-img" v-for="(item, index) in list" :src="item.src" height="100" @click="$preview.open(index, list)" :key="item.src">  -->

    <div class="center" v-html="parenst.content">内容</div>
    <cobs :id="id"></cobs>
  </div>
</template>
<script>
import comes from "../subComponents/discuss";
export default {
  data() {
    return {
      id: this.$route.params.id,
      parenst: {},
      slide1: []
    };
  },
  created() {
    this.getparticular();
    this.gethtopur();
  },
  methods: {
    getparticular() {
      this.$http
        .get("http://www.liulongbin.top:3005/api/getimageInfo/" + this.id)
        .then(res => {
          //   console.log(res);

          if (res.body.status === 0) {
            this.parenst = res.body.message[0];
          }
        });
    },
    gethtopur() {
      this.$http
        .get("http://www.liulongbin.top:3005/api/getthumimages/" + this.id)
        .then(res => {
          if (res.body.status === 0) {
            res.body.message.forEach(item => {
              item.w = 600;
              item.h = 400;
              item.msrc = item.src;
            });
            this.slide1 = res.body.message;
          }
        });
    }
    // handleClose () {
    //     console.log('close event')
    //   }
  },
  components: {
    cobs: comes
  }
};
</script>
<style lang="less">
.particular-fotre {
  padding: 10px;
  h3 {
    font-size: 14px;
    color: aqua;
    text-align: center;
    margin: 15px 0;
  }
  .strate {
    display: flex;
    justify-content: space-between;
  }
  .center {
    font-size: 12px;
  }
  .photosBox {
    width: 100%;
    .my-gallery {
        width: 100%;
      figure {
        display: inline-block;
        width: 30%;
        margin: 0;
        padding: 0;
        margin: 5px;
        a {
          width: 100%;
          display: inline-block;
          img {
            width: 100%;
          }
        }
      }
    }
  }
}
</style>
